package com.bw.controller;

import com.bw.entity.TbDing;
import com.bw.service.DefinitionService;
import com.bw.vo.TbDingYi;
import com.bw.vo.TbType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class DefinitionController {

    @Autowired
    private DefinitionService studentService;

    @GetMapping("dingyiList")
    public List dingyiList(@RequestParam("mohu") String mohu){
        return studentService.dingyiList(mohu);
    }

    @GetMapping("update")
    public TbDing update(@RequestParam("id")int id){
        return studentService.update(id);
    }

    @GetMapping("typeList")
    public List<TbType> typeList(@RequestParam("mohu")String mohu){
        return studentService.typeList(mohu);
    }

    @GetMapping("findBytype")
    public TbType findBytype(@RequestParam("id")int id){
        return studentService.findBytype(id);
    }

    @PostMapping("updateBytype")
    public void updateBytype(@RequestBody TbType tbType){
        studentService.updateBytype(tbType);
    }

    @PostMapping("addBytype")
    public void addBytype(@RequestBody TbType tbType){
        studentService.addBytype(tbType);
    }

    @GetMapping("findBydingyi")
    public TbDingYi findBydingyi(@RequestParam("id")int id){
        return studentService.findBydingyi(id);
    }
    @PostMapping("updateBydingyi")
    public void updateBydingyi(@RequestBody TbDing tbDing){
        studentService.updateBydingyi(tbDing);
    }
    @PostMapping("dingyiadds")
    public void dingyiadds(@RequestBody TbDing tbDing){
        studentService.dingyiadds(tbDing);
    }
    @PostMapping("updateBydingyiId")
    public void updateBydingyiId(@RequestParam("id") String id){
        studentService.updateBydingyiId(id);
    }
    @PostMapping("updateBydingyiIdd")
    public void updateBydingyiIdd(@RequestParam("id")String id){
        studentService.updateBydingyiIdd(id);
    }
    @GetMapping("deldingyi")
    public void deldingyi(@RequestParam("ids") String ids){
        studentService.deldingyi(ids);
    }
    @GetMapping("deltype")
    public void deltype(@RequestParam("ids")String ids){
        studentService.deltype(ids);
    }
//    @GetMapping("getList")
//    public List getList(){
//        return studentService.getList();
//    }
//
//    @GetMapping("del")
//    public void del(@RequestParam("id") int id){
//        studentService.del(id);
//    }
//
//    @PostMapping("add")
//    public void add(@RequestBody Student student){
//        studentService.add(student);
//    }
//
//    @PostMapping("update")
//    public void update(@RequestBody Student student){
//        studentService.update(student);
//    }
//
//    @GetMapping("getClazz")
//    public List getClazz(){
//        return studentService.getClazz();
//    }
//
//    @GetMapping("getStudentById")
//    public Student getStudentById(@RequestParam("id") int id){
//        return studentService.getStudentById(id);
//    }

}
